getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Sun, 14 Jul 2024 21:37:43 +0000 (14:37 -0700)
committerRyan Tandy <ryan@nardis.ca>
Sun, 14 Jul 2024 21:37:43 +0000 (14:37 -0700)
commitc5b7fae09116069591603bf72fbed77653797041
tree587b22639018ccf0d481c6bbadbc9758012cbb53
parent0bfb1dca5e3999d5337570c8b38e42f586233dee
getaddrinfo-is-threadsafe

OpenLDAP upstream conservatively assumes that certain resolver functions
(getaddrinfo, getnameinfo, res_query, dn_expand) are not re-entrant; but we
know that the glibc implementations of these functions are thread-safe, so
we should bypass the use of this mutex.  This fixes a locking problem when
an application uses libldap and libnss-ldap is also used for hosts
resolution.

Closes Debian bug #340601.

Not suitable for forwarding upstream; might be made suitable by adding a
configure-time check for glibc and disabling the mutex only on known
thread-safe implementations.

Gbp-Pq: Name getaddrinfo-is-threadsafe
libraries/libldap/os-ip.c
libraries/libldap/util-int.c